﻿#include "widget.h"
#include "ui_widget.h"
#include "../../CatTools/QrenCode/Src/QrenCodeWidget/QtQrenCode.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::resizeEvent(QResizeEvent *event)
{
    QPixmap qrPixmap;

    int width = ui->label->width();
    int height = ui->label->height();
    QString test = "hello, world";
    GernerateQRCode(test, qrPixmap, QSize(width, height), ":/LOGO.png");
    /*qrPixmap = qrPixmap.scaled(QSize(width, height),
                               Qt::IgnoreAspectRatio, Qt::SmoothTransformation);*/
    ui->label->setPixmap(qrPixmap);
}

